package com.gang.mars.basic.jdk18.stream;

import java.util.stream.Stream;

/**
 * @Author：gang.chen
 * @Date：2023/9/4 9:41
 */
public class StreamInstance {

    public static void main(String[] args) {

        Employee[] init = Employee.init();

        Stream<Employee> employeeStream = Stream.of(init);

        System.out.println(employeeStream);
    }




    static class Employee{
        int No;
        String name;
        double salary;

        public Employee() {
        }

        public Employee(int no, String name, double salary) {
            No = no;
            this.name = name;
            this.salary = salary;
        }

        public static Employee[] init(){
            Employee[] arrayOfEms = {new Employee(1,"jef",10.0), new Employee(2,"bill", 20.0),new Employee(3,"mark", 30.0)};
            return arrayOfEms;
        }
    }
}
